-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(mainnet): pallet_proxy config & tests #441
refactor(mainnet): pallet_proxy config & tests #441
Conversation
7359e7a
to
9594a3b
Compare
c4126d4
to
f73d4e5
Compare
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## al3mart/refactor-mainnet-config #441 +/- ##
===================================================================
+ Coverage 71.02% 71.46% +0.44%
===================================================================
Files 73 75 +2
Lines 13748 13971 +223
Branches 13748 13971 +223
===================================================================
+ Hits 9764 9984 +220
- Misses 3717 3720 +3
Partials 267 267
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only concern is around the ProxyDepositBase and ProxyDepositFactor.
- Wasn't able to calculate the value size myself (so not sure where the 16 comes from)
- Our deposits are several times more expensive than the polkadot relay.
runtime/mainnet/src/config/proxy.rs
Outdated
@@ -41,6 +39,17 @@ impl InstanceFilter<RuntimeCall> for ProxyType { | |||
} | |||
} | |||
|
|||
parameter_types! { | |||
// One storage item; key size 32, value size 16. | |||
pub const ProxyDepositBase: Balance = deposit(1, 48); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have 6 times the amount of bytes Polkadot has. Any reason not to just align to the Polkadot relay chain on this: https://github.com/polkadot-fellows/runtimes/blob/main/relay/polkadot/src/lib.rs#L977
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Certainly. Double checking after your comment I'm also seeing that I did the following miscalculation:
the number we have for ProxyDepositBase
was the result of adding AccountId
+ Balance
, but I realize that we should be accounting for 8 bytes, which is the correct length of the key of the map.
I also added the bytes for Balance
because the deposited amount is always stored. Although, as it is the size corresponding to the deposit itself, I could see why it is not being included on Polkadot's configuration.
ProxyDepositFactor
reasoning in the comment above its declaration, what's the concern ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed off GH this change updates ProxyDepositBase
from deposit(1, 48)
to deposit(1, 40)
.
0716b86
to
cd7ebb2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks for resolving the deposit issue. Makes much more sense now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing the explanation why are we not using the values from pop-common
anymore. Other than that, looking good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks for the updated tests, very good!
Extends proxy config module for the pallet:
pallet_proxy
Notable configuration items are:
pallet_proxy
Updated deposits for mainnet runtime:
[sc-2205]